<!--16-onblur事件.html-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>onblur事件</title>
    <script type="text/javascript">
        function onblurFunc() {
            console.log("静态注册失去焦点事件");
        }

        window.onload = function () {
            // 1. 获取标签对象
            let element = document.getElementById("input-01");

            element.onblur = function () {
                console.log("动态注册失去焦点事件");
            }
        }
    </script>
</head>
<body>
    用户名：<input type="text" onblur="onblurFunc();"/> <br/>
    密码：<input type="password" id="input-01"/> <br/>
</body>
</html>